package com.qianli.cashmama.trade.openApi.enums;

/**
 * @Author: cashmama
 * @Date: 2020/10/14-14:11
 * @Description: TODO
 * @Slogan: To be or not to be
 **/
public enum OrderStatusSwitchEnum {
    INIT(1, "INFORMATION TO BE ADDED", 0),
    AUDIT(2, "AUDITING", 2),
    AUDIT_PASS(3, "AUDIT_PASS", 3),
    DISBURSE_FAIL(4, "DISBURSE_FAIL", 4),
    DISBURSE_SUCCESS(5, "DISBURSE_SUCCESS", 5),
    OVERDUE(6, "OVERDUE", 6),
    REPAY_SUCCESS(7, "REPAY_SUCCESS", 7),
    EARLIER_REPAY_SUCCESS(8, "EARLIER_REPAY_SUCCESS", 7),
    OVERDUE_REPAY_SUCCESS(9, "OVERDUE_REPAY_SUCCESS", 7),
    AUDIT_REJECT(10, "AUDIT_REJECT", 7);

    OrderStatusSwitchEnum(Integer code, String name, Integer thirdOrderStatus) {
        this.code = code;
        this.name = name;
        this.thisOrderStatus = thirdOrderStatus;
    }

    private Integer code;
    private String name;
    private Integer thisOrderStatus;

    public Integer getCode() {
        return code;
    }

    public OrderStatusSwitchEnum setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getName() {
        return name;
    }

    public OrderStatusSwitchEnum setName(String name) {
        this.name = name;
        return this;
    }

    public Integer getThisOrderStatus() {
        return thisOrderStatus;
    }

    public void setThisOrderStatus(Integer thisOrderStatus) {
        this.thisOrderStatus = thisOrderStatus;
    }

    public static OrderStatusSwitchEnum getOrderStatus(Integer code) {
        OrderStatusSwitchEnum orderStatusEnum = null;
        for (OrderStatusSwitchEnum statusEnum : OrderStatusSwitchEnum.values()) {
            if (statusEnum.getCode().equals(code)) {
                orderStatusEnum = statusEnum;
            }
        }
        return orderStatusEnum;
    }

}
